package com.mdd.front.config;

import com.icbc.api.DefaultIcbcClient;
import com.icbc.api.IcbcClient;
import com.icbc.api.IcbcConstants;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Component
public class DefaultIcbcClientConfig {

    @Value("${icbc.appId}")
    private String APPID;

    @Value("${icbc.privateKey}")
    private String MY_PRIVATE_KEY;


    @Value("${icbc.publicKey}")
    private String APIGW_PUBLIC_KEY;


    @Bean("defaultIcbcClient")
    public IcbcClient defaultIcbcClient() {
        return new DefaultIcbcClient(this.APPID, IcbcConstants.SIGN_TYPE_RSA2, this.MY_PRIVATE_KEY, this.APIGW_PUBLIC_KEY);
    }


}
